package com.gtxy.yyf.doris.common.config;


import com.github.pagehelper.PageHelper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @PackageName: com.gtxy.yyf.doris.common.config
 * @author: youjp
 * @slogan: 天下风云出我辈，一入代码岁月催
 * @create: 2022-06-11 09:53
 * @description: 分页配置
 * @Version: 1.0
 */

@Configuration //代表这是一个配置类
public class PageHelperConfig {

    @Bean
    public PageHelper pageHelper(){
        PageHelper pageHelper = new PageHelper();
        Properties p = new Properties();
        p.setProperty("offsetAsPageNum", "true");
        p.setProperty("rowBoundsWithCount", "true");
        p.setProperty("reasonable", "true");
        pageHelper.setProperties(p);
        return pageHelper;
    }

}
